package cn.qyd.javastring;

import com.sun.istack.internal.NotNull;

import java.io.Serializable;

/**
 * @author 邱运铎
 * @date 2024-03-07 14:26
 */
public class StringMethodDemo {
    public static void main(String[] args) {
        String str = "Hello, world!!";
        int indexofnum = str.indexOf("world");
        System.out.println(indexofnum);

        indexofnum = str.indexOf(",");
        System.out.println(indexofnum);

        //indexof默认从0位置开始搜索

        indexofnum = str.indexOf("l",1);
        System.out.println(indexofnum);
        indexofnum = str.indexOf("l",3);
        System.out.println(indexofnum);
        indexofnum = str.indexOf("l",4);
        System.out.println(indexofnum);

        char[] chars = new char[]{' ','i','u'};
        System.out.println(chars[1] >= ' ');

        System.out.println(str.equals("Hello, world!!"));
    }
}
